<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>  
<%@ taglib uri="http://www.xnx3.com/java_xnx3/xnx3_tld" prefix="x" %>
<jsp:include page="/wm/common/head.jsp">
	<jsp:param name="title" value="日志列表"/>
</jsp:include>

<table class="layui-table iw_table">
  <thead>
    <tr>
        <th>坐席名称</th>
        <th>客户昵称</th>
        <th>客户发言</th>
        <th>坐席发言</th>
        <th>服务时间</th>
        <th>服务时长</th>
    </tr>
  </thead>
  <tbody>
  	<c:forEach items="${list}" var="log">
  		<tr style="cursor: pointer;" onclick="chatLog('${log['zuoxiChatId']}', '${log['otherChatId']}', '${log['logtime']*1000 + 1000}', '${log['zuoxiNickname'] }')">
          <td><x:substring maxLength="12" text="${log['zuoxiNickname'] }"></x:substring></td>
          <td><x:substring maxLength="12" text="${log['otherNickname'] }"></x:substring></td>
          <td>${log['zuoxiReceiveCount'] }次</td>
          <td>${log['zuoxiSendCount'] }次</td>
          <td>
          	<x:time linuxTime="${log['logtime']-log['serviceTime'] }" format="yy-MM-dd HH:mm:ss"></x:time>
          	~
          	<x:time linuxTime="${log['logtime'] }" format="HH:mm:ss"></x:time>
          </td>
          <td>${log['serviceTime'] }秒</td>
      </tr>
    </c:forEach>
  </tbody>
</table>
<!-- 通用分页跳转 -->
<jsp:include page="/wm/common/page.jsp"></jsp:include>

<script>
//弹出聊天日志窗口
function chatLog(chatId, otherChatId, logtime, zuoxiName){
	layer.open({
		type: 2, 
		title:'查看坐席['+zuoxiName+']的聊天记录', 
		area: ['400px', '600px'],
		shadeClose: true, //开启遮罩关闭
		content: 'chatLog.do?chatId=' + chatId + '&otherChatId='+otherChatId + '&time='+logtime
	});	 
}
</script>

<jsp:include page="/wm/common/foot.jsp"></jsp:include>